﻿namespace Web.Control.Member.My.Profile
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;
    using System.IO;

    using BLF.WWW_User.Users;
    using Model.WWW_User.User;
    using Model.WWW_User.Teach;
    using System.Collections.Generic;

    public class Personal : BaseControl
    {
        /// <summary>
        /// 用户信息
        /// </summary>
        protected UpdateUserModel UserInfo=null;
        /// <summary>
        /// 当前会员号
        /// </summary>
        protected string MemberNo = "";
        /// <summary>
        /// 教/学 时间列表
        /// </summary>
        protected List<TeachModel> TimeList;

        protected Lx.Web.Common.UI.DatePanel BOD;
        protected override void OnLoad(EventArgs e)
        {
            MemberNo = HttpContext.Current.User.Identity.Name;
            ArrayList arrlist = new ArrayList();
            if (MemberNo == "")
            {
                Page.Response.Redirect("/user/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
                return;
            }
            arrlist = User.GetPersonalProf(MemberNo);
            if (arrlist == null && arrlist.Count!=0)
            {
                Response.End();
                return;
            }
            else
            {
                UserInfo = arrlist[0] as UpdateUserModel;
                TimeList = arrlist[1] as List<TeachModel>;
                if (BOD != null && UserInfo.BOD != DateTime.Parse("1900-1-1"))
                {

                    BOD.Text = UserInfo.BOD.ToString("yyyy-MM-dd");
                }
            }
            base.OnLoad(e);
        }
    }
}

